<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<div class="table-scrollable">
	<table class="table table-striped table-hover table-success">
		<thead>
			<tr>
				<th>定区编号</th>
				<th>定区名称</th>
				<th>负责人</th>
				<th>联系电话</th>
				<th>所属公司</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.result }" var="decidedzone" varStatus="vs">
			<tr>
				<td>${decidedzone.id}</td>
				<td>${decidedzone.name}</td>
				<td>${decidedzone.staff.name}</td>
				<td>${decidedzone.staff.telephone}</td>
				<td>${decidedzone.staff.station}</td>
				<td>
					<a href="javascript:;" class="btn btn-sm blue" onclick="update('/decidedzone/decidedzone?id=${decidedzone.id}')">
						<i class="fa fa-edit"></i>编辑
					</a>
					<a href="javascript:;" class="btn btn-sm red" onclick="del('/decidedzone/delete?id=${decidedzone.id}')">
						<i class="fa fa-trash"></i>删除
					</a>
					<a href="javascript:;" class="btn btn-sm green" onclick="showRelation('/decidedzone/relationCustomers?id=${decidedzone.id}')">
						<i class="fa fa-trash"></i>关联客户
					</a>
				</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
<div class="pageination-panel">${page}</div>
<script type="text/javascript">

	function showRelation(url){
		$.ajax({
			type: 'get',
			url: webRoot+url,
			dataType: 'html',
			success: function(data){
				$(".panel-search").hide();
				$(".panel-content").html(data);
			}
		});
	} 

</script>